﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace Server
{
    /// <summary>
    /// Class représentant un flux Rss (sans ses items)
    /// </summary>
    [DataContract]
    public class RssFeed
    {
        [DataMember]
        public int id { get; set; }
        [DataMember]
        public String title { get; set; }
        [DataMember]
        public String description { get; set; }
        [DataMember]
        public String link { get; set; }
        [DataMember]
        public String url { get; set; }
        [DataMember]
        public DateTime date { get; set; }
        [DataMember]
        public bool @public { get; set; }
    }

    /// <summary>
    /// Class représnentant un item d'un flux Rss
    /// </summary>
    [DataContract]
    public class RssFeedItem
    {
        [DataMember]
        public int id { get; set; }
        [DataMember]
        public String title { get; set; }
        [DataMember]
        public String description { get; set; }
        [DataMember]
        public DateTime date { get; set; }
        [DataMember]
        public String link { get; set; }
        [DataMember]
        public bool read { get; set; }
    }

    /// <summary>
    /// Class Représentant la session de l'utilisateur
    /// Requis pour s'autentifier lors des appel au service
    /// </summary>
    [DataContract]
    public class Session
    {
        [DataMember]
        public String id { get; set; }
        [DataMember]
        public ServiceDevice version { get; set; }
        [DataMember]
        public ServiceStatus status { get; set; } 
    }

    /// <summary>
    /// Enum contenant les status possible recu par certains objet (cf Session)
    /// Permet de savoir si une erreur a eu lieu.
    /// </summary>
    [DataContract]
    public enum ServiceStatus : int {
        [EnumMember()]
        Success = 1,
        [EnumMember()]
        ServerError = 0,
        [EnumMember()]
        WrongParameter = -1,
        [EnumMember()]
        ConnectedOnAnotherDevice = -2
    }

    /// <summary>
    /// Enum contenant la liste des plateformes disponible
    /// </summary>
    [DataContract]
    public enum ServiceDevice : int {
        [EnumMember()]
        WPF = 1,
        [EnumMember()]
        WP7 = 2,
        [EnumMember()]
        Silverlight = 3,
        [EnumMember()]
        Outlook = 4
    }
}